#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1010;
int arr[N];
int b[N];
int n, d;
int main()
{
	cin >> n >> d;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++) {
		sort(b, b + i);
		b[i] = arr[i];
		for (int j = 0; j < i; j++) {
			if (abs(b[i] - b[j]) < d) {
				b[i] = b[j] + d;
			}
		}
		cout << b[i] << " ";
	}
	return 0;
}